home *** CD-ROM | disk | FTP | other *** search
- Program M2;
-
- { SPX library - Parallax demo Copyright 1993 Scott D. Ramsay }
- {$A-,B-,D+,E-,F-,G+,I-,L+,N-,O-,R-,S-,V-,X+} {TP 6.0 & 286 required!}
-
-
-
- Uses eco_env,dos,crt,
- spx_gui,spx_vga,spx_txt,spx_eff,spx_key,spx_img,spx_fnc,
- mouse;
-
- const
- path = '\bin\'; { default work path }
- menumax =9;
-
-
- var
- menuno : integer;
- loadpic : boolean;
- byeno : integer;
- mb0,mb1,mx,my : integer; {mouse button,x,y}
- p,q : pButton;
-
- e : envrec;
- ss : string;
- vs : string;
- status : integer;
-
-
-
-
- Procedure Procloadpic;
- begin
- mouseoff;
- loadpcx(path+'menublk'+chr(48+menuno)+'.pcx'); { load pcx file on page 2 }
- fsetcolors(rgb256); { set the palette to the pcx palette }
- mouseon;
- loadpic :=false;
- repeat
- getmouse(mb0,mx,my);
- until (mb1<>mb0) or anykey;
- end;
-
-
-
- procedure nextmenu(i:integer);
- begin
- menuno:=menuno+i;
- loadpic:=true;
- if menuno>menumax then menuno:=0;
- if menuno<0 then menuno:=menumax;
- end;
-
-
- function mouseat(x,y : integer) : boolean;
- begin
- mouseat :=(abs((x+40)-mx/2)<41) and (abs((y+25)-my)<26);
- end;
-
-
-
- begin
- menuno:=vl(getenv('game')) div 10;
- openmode(1);
- setpageactive(1);
- setpageactive(1);
-
- mousereset;
- setdefptr;
-
- menuno:=vl(getenv('game')) div 10;
- loadpic := true;
- byeno:=100;
-
- {Main loop}
- repeat
- if loadPic then Procloadpic;
- getmouse(mb0,mx,my);
- delay(200);
- getmouse(mb1,mx,my);
-
- if mb0<>mb1 then {keypressed}
-
- begin
-
- if mouseat(20,10) then byeno:=1+menuno*10;
- if mouseat(20,10+50+10) then byeno:=4+menuno*10;
- if mouseat(20,10+50+10+50+10) then byeno:=7+menuno*10;
-
- if mouseat(20+80+10,10) then byeno:=2+menuno*10;
- if mouseat(20+80+10,10+50+10) then byeno:=5+menuno*10;
- if mouseat(20+80+10,10+50+10+50+10) then byeno:=8+menuno*10;
-
- if mouseat(20+80+10+80,10) then byeno:=3+menuno*10;
- if mouseat(20+80+10+80,10+50+10) then byeno:=6+menuno*10;
- if mouseat(20+80+10+80,10+50+10+50+10) then byeno:=9+menuno*10;
-
-
-
- if (mx/2>300) and (my>180) then nextmenu(-1);
- if (mx/2>300) and (my<20) then nextmenu(1);
- if (mx/2<12) and (my<20) then byeno:=0;
- end;
- until byeno<100;
- FadeOut(30,rgb256);
- closemode;
- textmode(co80);
- masterenv(e);
- writeln('Game :' , byeno:4);
- setenvstr(e, 'game', lz(byeno,2)) ;
- end.
-